mm/page_alloc: fix MEMF_no_dma allocations for single NUMA
authorSergey Dyasli <sergey.dyasli@citrix.com>
Fri, 1 Feb 2019 10:33:44 +0000 (11:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 1 Feb 2019 10:33:44 +0000 (11:33 +0100)
commit198672807ec6c6a1dee07841433a3064cb446a89
treeb918be03989ab35087c93bd79554f807659439e9
parent2cd833de4dae3898849a0eea5298644e2890e018
mm/page_alloc: fix MEMF_no_dma allocations for single NUMA

Currently dma_bitsize is zero by default on single NUMA node machines.
This makes all alloc_domheap_pages() calls with MEMF_no_dma return NULL.

There is only 1 user of MEMF_no_dma: dom0_memflags, which are used
during memory allocation for Dom0. Failing allocation with default
dom0_memflags is especially severe for the PV Dom0 case: it makes
alloc_chunk() to use suboptimal 2MB allocation algorithm with a search
for higher memory addresses.

This can lead to the NMI watchdog timeout during PV Dom0 construction
on some machines, which can be worked around by specifying "dma_bits"
in Xen's cmdline manually.

Fix the issue by ignoring MEMF_no_dma in cases when dma_bitsize is zero,
which means there is no DMA zone. This shouldn't cause any issues for
Dom0 because alloc_heap_pages() will first use higher memory addresses
for satisfying memory allocation requests.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 5ac2dddb173b69be259ce4b259e73f971a4816c1
master date: 2019-01-09 15:45:14 +0100
xen/common/page_alloc.c